<!--
 * @Description:支付成功或者取消订单页面
 * @version: v1.0
 * @Author: Wang Xi
 * @Date: 2023-5-10 10:10:00
 * @LastEditors: Yejing
 * @LastEditTime: 2023-06-24 09:49:30
-->
<template>
	<view class="payment-cancel-container">
		<c-layout>
			<!-- <c-navigation-bar :showBack="false" :title="current[type].title" slot="head"></c-navigation-bar> -->
			<c-navigation-bar slot="head" :title="current[type].title"></c-navigation-bar>
			<view class="container-box">
				<view class="center-box">
					<view class="icon-box">
						<u-icon name="checkmark"></u-icon>
					</view>
					<view class="text">
						<h2>{{ current[type].title2 }}</h2>
						<text>{{ current[type].des }}</text>
					</view>
					<u-button @click="backEvent">{{this.$t('card.success')}}</u-button>
				</view>
			</view>
		</c-layout>
	</view>
</template>

<script>
export default {
	data() {
		return {
			current: [
				{
					title: this.$t('orderDetails.PaymentSucceeded'),
					title2:this.$t('orderDetails.PaymentSucceeded'),
					des: this.$t('orderDetails.PaymentSucceededTips')
				},
				{
					title: this.$t('orderDetails.canceled'),
					title2: this.$t('orderDetails.canceled'),
					des: this.$t('orderDetails.canceledTips'),
				}
			],
			type: 0
		};
	},
	onLoad(data) {
		data.type && (this.type = data.type);
	},
	methods: {
		backEvent() {
			if(uni.getStorageSync('liveBar_anchorId')){
				let id=uni.getStorageSync('liveBar_anchorId')
				uni.navigateTo({ url: `/pages/liveBar/livePlayer/livePlayer?userId=${id} `});
			}else{
				
			uni.navigateTo({ url: '/pages/order/myOrder' });
			}
			
		}
	}
};
</script>

<style lang="scss" scoped>
.payment-cancel-container {
	font-family: SFUIDisplay-Medium-Regular, SFUIDisplay-Medium;
	.container-box {
		position: relative;
		height: 100%;

		.center-box {
			position: absolute;
			left: 50%;
			top: 40%;
			transform: translate(-50%, -50%);
			display: flex;
			flex-direction: column;
			align-items: center;

			.icon-box {
				width: 160rpx;
				height: 160rpx;
				border-radius: 50%;
				background-color: #e9e9e9;
				line-height: 160rpx;
				text-align: center;
				font-size: 60rpx;
			}

			.text {
				white-space: nowrap;
				text-align: center;
				margin: 50rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				flex-direction: column;
				h2 {
					font-size: 36rpx;
					font-weight: 500;
					margin-top: 5vh;
					text-align: center;
					display: block;
				}

				text {
					font-size: 26rpx;
					padding-top: 2vh;
				}
			}

			uni-button {
				color: #fff;
				background-color: #2934d0;
				border-radius: 20rpx;
				height: 120rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				padding: 0;
				width: 100%;
				margin-top: 30rpx;
			}
		}
	}
}
</style>
